package com.AJava1710D.bingfabao.testThreadLocal;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 作者: LCG
 * 日期: 2020/6/24 10:37
 * 描述:
 */

@RestController
public class TestThreadLocal111 {

    private ThreadLocalUtils111 threadLocalUtils111=new ThreadLocalUtils111();

    @RequestMapping("tt1")
    public void test01(){

        YYYY yyyy = threadLocalUtils111.getYYYY();
        System.out.println(Thread.currentThread().getName()+"=====改变之前===="+yyyy.getUserName());
        yyyy.setUserName("uuuuuuuu");

        YYYY yyyy1 = threadLocalUtils111.getYYYY();

        System.out.println("=====改变之后===="+yyyy1.getUserName());

    }

    @RequestMapping("tt2")
    public void test02(){

        YYYY yyyy = threadLocalUtils111.getYYYY();
        System.out.println(Thread.currentThread().getName()+"=====改变之前===="+yyyy.getUserName());

    }

}
